<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html><head>
    <title>NKDEAN13Barcode</title>
	<meta name="generator" content="HeaderDoc">
</head><body bgcolor="#ffffff"><h1><font face="Geneva,Arial,Helvtica">NKDEAN13Barcode</font></h1><hr><br>
<h2>Discussion</h2>
 <hr><br><h2>Methods</h2>

<h3><a name="_parityForSystemDigit:forIndex:">_parityForSystemDigit:forIndex:</a></h3>
<b>Abstract:</b> Lookup method used to encode the system digit in the parity of the next five digits

<blockquote><pre><tt>- (BOOL)<B>_parityForSystemDigit:</B>(char)systemDigit
                   <I></I> <B>forIndex:</B>(int)<I>index;</I> </tt><br>
</pre></blockquote>
<p></p>
<h4>Parameters</h4>
<blockquote>
<table border="1"  width="90%">
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tr><td align="center"><tt>systemDigit</tt></td><td>Character representing the first character in content</td></tr>
<tr><td align="center"><tt>index</tt></td><td>The index of the character being encoded</td></tr>
</table>
</blockquote>
<b>Result:</b> EVEN_PARITY or ODD_PARITY
 
<hr>

<h3><a name="barcode">barcode</a></h3>
<b>Abstract:</b> Overridden to deal with various character parity options.

<blockquote><pre><tt>- (NSString *)<B>barcode;</B> </tt><br>
</pre></blockquote>
<p></p>
<b>Result:</b> String of 0s and 1s that represent the encoded content, excluding initiator and terminator
 
<hr>

<h3><a name="caption">caption</a></h3>
<b>Abstract:</b> Overridden to display 12 characters below, rather than the 10 that UPC shows below

<blockquote><pre><tt>- (NSString *)<B>caption;</B> </tt><br>
</pre></blockquote>
<p></p>
<b>Result:</b> String representing the encoded characters, formatted to appear correctly when drawn

<hr>

<h3><a name="digitsToRight">digitsToRight</a></h3>
<b>Abstract:</b> Overridden to specify that one character of the caption prints to the right of the barcode

<blockquote><pre><tt>- (int)<B>digitsToRight;</B> </tt><br>
</pre></blockquote>
<p></p>
<b>Result:</b> 0
 
<hr>

<h3><a name="generateChecksum">generateChecksum</a></h3>
<b>Abstract:</b> Overridden to generate EAN check digit

<blockquote><pre><tt>- (void)<B>generateChecksum;</B> </tt><br>
</pre></blockquote>
<p>The algorithm is exactly the same as the UPC-A, except that we must take into
account the additional system digit.
</p>
<hr>

<h3><a name="initWithContent:">initWithContent:</a></h3>
<blockquote><pre><tt>- (id)<B>initWithContent:</B>(NSString *)inContent
      <I></I> <B>printsCaption:</B>(BOOL)<I>inPrints;</I> </tt><br>
</pre></blockquote>
<p>printsCaption:
</p>
<h4>Parameters</h4>
<blockquote>
<table border="1"  width="90%">
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tr><td align="center"><tt>inContent</tt></td><td>A string containing the data to be encoded; should use only <B>ASCII-8</B> characters
(those that can be encoded using a single char in UTF-8)</td></tr>
<tr><td align="center"><tt>inPrints</tt></td><td>YES if caption should print.</td></tr>
</table>
</blockquote>
<b>Result:</b> Returns initialized NKDBarcode class
 
<hr>

<h3><a name="isContentValid">isContentValid</a></h3>
<b>Abstract:</b> Validates that this barcode supports the data it is encoding.

<blockquote><pre><tt>- (BOOL)<B>isContentValid;</B> </tt><br>
</pre></blockquote>
<p>Enforces numerics only and length of content; does not validate check digit.
</p>
<hr>

<h3><a name="rightCaption">rightCaption</a></h3>
<b>Abstract:</b> Overridden to specify that the no digits print to the right of the caption

<blockquote><pre><tt>- (NSString *)<B>rightCaption;</B> </tt><br>
</pre></blockquote>
<p></p>
<b>Result:</b> Empty string
 
<hr>
<p>(Last Updated 4/21/2003)
</p></body></html>
